﻿Imports Microsoft.ServiceHosting.ServiceRuntime
Imports Microsoft.Samples.ServiceHosting.StorageClient
Partial Public Class _Default
  Inherits System.Web.UI.Page

  Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    Call CheckParameters()
    If Not (bParametersLoaded) Then Response.Redirect("/error.htm")
    If iIsInUpgrade Then Response.Redirect("/upgrade.htn")
  End Sub

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Call LogMessage("Default page loaded", EventLogEntryType.Information)
  End Sub

  Protected Sub butRedirect_Click(ByVal sender As Object, ByVal e As EventArgs) Handles butRedirect.Click
    Session("Username") = "spam@ehuna.org"
    Response.Redirect("WebForm2.aspx")
  End Sub

  Protected Sub butAddToQueue_Click(ByVal sender As Object, ByVal e As EventArgs) Handles butAddToQueue.Click
    Dim oMessage As Message

    oMessage = New Message("This is the message " + Now.ToUniversalTime.ToString)
    oMessageQueue.PutMessage(oMessage)
  End Sub
End Class